package com.goods.business.converter;

import com.goods.common.model.business.Product;
import com.goods.common.model.business.ProductCategoryTreeNode;
import com.goods.common.vo.business.ProductCategoryTreeNodeVO;
import com.goods.common.vo.business.ProductVO;
import org.springframework.beans.BeanUtils;

/**
 * @Author: 赵勇镔
 * @Time: 2021/6/8 15:59
 * @Description:
 */
public class ProductConverter {

    /**
     * 转vo
     * @return
     */
    public static ProductVO converterProductVO (Product product){
        ProductVO productVO = new ProductVO();
        BeanUtils.copyProperties(product,productVO);
        return productVO;
    }

    public static Product converterProduct (ProductVO productVO){
        Product product = new Product();
        BeanUtils.copyProperties(productVO,product);
        return product;
    }
}
